package com.atao.baokede.mapper;

import com.atao.baokede.pojo.Category;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {
    // 查询所有分类
    @Select("select * from category")
    List<Category> list();

    // 添加分类
    @Insert("insert into category(name) values(#{categoryName})")
    void addCategory(String categoryName);
}